<?php
namespace app\admin\controller\operate;
use think\Db;
class Accounts extends \app\admin\controller\Common
{
 
    public function index(){
        $manage_rebate = (new \app\common\model\UserOrders())->where([
            'state' => 7
        ])->group('manage_id')->append(['manage_name_text'])->select()->toArray();
        $manage_rebate_title = json_encode(array_column($manage_rebate,"manage_name_text"), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
        $manage_rebate_money = [];
        foreach ($manage_rebate as $key => $value) {
             $manage_rebate_money[] = (new \app\common\model\UserOrders())->where(['manage_id' => $value['manage_id']])->sum('manage_rebate');
        }
        $manage_rebate_money = json_encode($manage_rebate_money, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
        $this->assign('manage_rebate_title',$manage_rebate_title);
        $this->assign('manage_rebate_money',$manage_rebate_money);
        return $this->fetch('index');
    }

   

   

  

 
}
